32.3 The XML folder

In the XML folder an extensions.xml file is automatically created with the following code

<?xml version=”1.0” encoding=”UTF8”?> 
<extensions />

This file is used to make settings for the integration of your plugin within Insensa GIS.

We suggest to define the namespace for the xml file using the following code. This will allow autocompletion in IDEs.

<?xml version=”1.0” encoding=”UTF8”?> 
 <extensions xmlns=”https://insensa.org/xsd/extensions”> 
</extensions>

In the next step you have to define the extension type(s) you have developed.

As you can combine multiple function types within one plugin, you need different tags, one for each type you have included.

The following types are available:

  • infoReaders: functions of type InfoReader
  • options: functions of type OptionFileChanger
  • connections: functions of type Connection
  • infoConnections: functions of type infoConnection
  • files: functions that are available for any file
  • exporter: exporter functions available under the menu item import
  • importer: importer functions available under the menu item export

For each function type add one name tag to the xml file as follows

<?xml version=”1.0” encoding=”UTF8”?> 
 <extensions xmlns=”https://insensa.org/xsd/extensions”> 
 
    <inforeaders> 
    </inforeaders> 
 
    <options> 
    </options> 
 
    <connections> 
    </connections> 
 
    ... 
</extensions>

For each function type create an entry for each function being executed e.g. for inforeader:

<?xml version=”1.0” encoding=”UTF8”?> 
 <extensions xmlns=”https://insensa.org/xsd/extensions”> 
 
    <inforeaders> 
        <inforeader id=”RInfoReaderExample”> 
                        <service 
                        type=”exec” 
                        priority=”medium” 
                        name=”R_InfoReaderExample”/> 
                        <script 
                        language=”R” 
                        filename=”infoReaderExampleScript.R”/> 
        </inforeader> 
    </inforeaders> 
 
    <options> 
    </options> 
 
    <connections> 
    </connections> 
 
    ... 
</extensions>

where id should be a unique identifier that is later used in the user interface to access this function. Service type can be on of the following

  • exec: referring to a function being executed within inensa GIS
  • settings: opening a settings window
  • viewer: referring to the visualization of a result e.g. in a diagram

Priority should be set to medium and name may be the same as the id but does not have to be unique. The following script tag defines the language of the plugin. At the moment R and Java are possible and filename is the filename of the script.

For Java Plugins, the package as well as the classname need to be defined as well.

It is possible to add help to the insensa UI and documentation of Insensa GIS authomatically. Add a help tag to the settings service tag as following:

<?xml version=”1.0” encoding=”UTF8”?> 
 <extensions xmlns=”https://insensa.org/xsd/extensions”> 
 
    <inforeaders> 
        <inforeader id=”RInfoReaderExample”> 
 
                        <service 
                        type=”exec” 
                        priority=”medium” 
                        name=”R_InfoReaderExample”> 
                <script 
                language=”R” 
                filename=”infoReaderExampleScript.R”/> 
                        </service> 
 
            <service 
            type=”settings” 
            priority=”medium” 
            name=”R_InfoReaderSettings”> 
                <script 
                filename=”R_InfoReaderSettings.R” 
                language=”R” /> 
                <help 
                filename=”index.html” 
                id=”helpInfoReaderExample” 
                toc=”InfoReaderExampleTOC”/> 
            </service> 
 
        </inforeader> 
    </inforeaders> 
 
    <options> 
    </options> 
 
    <connections> 
    </connections> 
 
    ... 
</extensions>